package com.cnhis.cloudhealth.clinical.medical.base.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.cnhis.cloudhealth.clinical.medical.base.bo.MsysUserparametersBo;
import com.cnhis.cloudhealth.clinical.medical.base.mapper.MsysUserparameters;
import com.cnhis.cloudhealth.commons.newid.GetNewId;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * Created by hdd on 2016/6/13.
 */
@Service
public class MsysUserparametersImpl implements IMsysUserparameters {

    private static Logger logger = Logger.getLogger(MsysUserparameters.class);

    @Autowired
    private MsysUserparametersBo msysUserparametersBo;

    @Autowired
    private GetNewId getNewId;

    /**
     * @param param
     * @return java.util.List<com.cnhis.cloudhealth.clinical.medical.base.mapper.MsysUserparameters>
     * @throws
     * @Title: findUserParameters
     * @Description: （根据当前科室与参数ids查询集合）
     * @author chengshaowei
     * @date 2017/10/30
     */
    public List<MsysUserparameters> findUserParameters(Map<String, Object> param) {
        return msysUserparametersBo.findUserParameters(param);
    }

    /**
     * @param list
     * @return void
     * @throws
     * @Title: batchinsertByVo
     * @Description: （批量保存科室级参数）
     * @author chengshaowei
     * @date 2017/10/30
     */
    public void batchinsertByVo(List<MsysUserparameters> list) throws Exception {
        for (MsysUserparameters p : list) {
            p.setId(getNewId.nextId() + "");
        }
        msysUserparametersBo.batchinsertByVo(list);
    }

    /**
     * @param list
     * @return void
     * @throws
     * @Title: batchupdateByVoNotNull
     * @Description: （批量修改科室级参数）
     * @author chengshaowei
     * @date 2017/10/30
     */
    public void batchupdateByVoNotNull(List<MsysUserparameters> list) throws Exception {
        msysUserparametersBo.batchupdateByVoNotNull(list);
    }
}
